<template>
	<!-- KMsb,KOsb,KCsb -->
	<view class="contain">
		<view class="card-contain">
			<view class=" card-public">
				<text>店铺号：{{detailInfo.storeGlobalId|| ''}}</text>
				<text>联系人：{{detailInfo.connectorName}}/{{detailInfo.connectorPhone}}</text>
				<text>店铺地址：{{detailInfo.address||"无"}}</text>
			</view>

			<view class="zong card-public">
				<u-collapse accordion>
					<u-collapse-item title="备注" name="Docs guide">
						<view class="user_box" style="width: 80%; margin: 40rpx auto;">
							<view class="user_for" v-for="(list,id) in remarklist" :key="id">
								<view class="line_box">
									<!-- 圆球 -->
									<view class="line_radio"
										:style="{ backgroundColor :  '#ef6f16' , border: 'solid 6rpx #fbc293' }">
									</view>
									<!-- 线 -->
									<view class="line_for" v-for="item in 3" :key="item" v-if="id<remarklist.length-1"
										:style="{ backgroundColor : '#ef6f16' }">
									</view>
								</view>
								<view class="right_box">
									<view class="title" :style="{ color : '#ef6f16'}">{{list.title}}
										<text style="margin-left: 20rpx;" v-if="list.title1">({{list.title1}})</text>
									</view>
									<view class="desc">
										{{list.desc||'无'}}
									</view>
								</view>
							</view>
						</view>
					</u-collapse-item>
					<u-collapse-item title="进度" name="Variety components">
						<view class="user_box" style="width: 80%; margin: 40rpx auto;">
							<view class="user_for" v-for="(list,id) in historyList" :key="id">
								<view class="line_box">
									<!-- 圆球 -->
									<view class="line_radio"
										:style="{ backgroundColor : list.istrue ? '#ef6f16' : '#8e8b8d' , border: list.istrue ? 'solid 6rpx #fbc293' : 'solid 6rpx #b9b7b6'}">
									</view>
									<!-- 线 -->
									<view class="line_for" v-for="item in 3" :key="item" v-if="id<historyList.length-1"
										:style="{ backgroundColor :  list.istrue ? '#ef6f16' : '#8e8b8d'}"></view>
								</view>
								<view class="right_box" :style="{ color : list.istrue ? '#ef6f16' : '#8e8b8d'}">
									<view class="title">{{list.title}}</view>
									<view class="desc" v-if="list.descTime">
										{{list.descTime}}
									</view>
								</view>
							</view>
						</view>
					</u-collapse-item>
				</u-collapse>
			</view>

			<view class="card-public">
				<text>外部工单号：{{detailInfo.maId}}</text>
				<text>故障描述：{{detailInfo.faultDescribe||'未知'}}</text>
				<text>响应级别：{{detailInfo.responseLevel}}</text>
			</view>
			<view class="card-public">
				<view class="textline">
					报修照片
				</view>
				<view v-for="(item,index) in fileList4" :key="index">
					<view class="image-content">
						<image @click="previewfileList0Image(item.url,4)" :src="item.url"
							style="width: 100px; height: 100px; background-color: #eeeeee;"></image>
					</view>
					<view class="image-title">{{item.text}}</view>
				</view>
			</view>
			<!-- 	<view class="card-public">
				<view class="textline">
					<picker :disabled="!canchange" mode="selector" @change="select($event,2)" :value="item.faultCode"
						:range="faultCode">
						<view>{{item.faultCode||"点击选择故障代码"}}</view>
					</picker>
				</view>

				<view class="textline">
					<picker :disabled="!canchange" mode="selector" @change="select($event,3)" :value="item.soluteCode"
						:range="soluteCode">
						<view>{{item.soluteCode||"点击选择解决代码"}}</view>
					</picker>
				</view>

				<view class="textline">
					<picker :disabled="!canchange" mode="selector" @change="select($event,4)" :value="item.repairType"
						:range="repairType">
						<view>{{item.repairType==="remote"?"远程":"上门"}}</view>
					</picker>
				</view>
			</view>
 -->
			<!-- 基本 -->
			<view class="card-public">
				<view class="textline" style="display: flex;">单号：{{item.workOrderId}} </view>
				<view class="textline" style="display: flex;">
					<picker :disabled="!canchange" mode="selector" @change="select($event,4)" :value="item.repairType"
						:range="repairType">方式：
						<text>{{item.repairType||'无'}}</text>
					</picker>
				</view>
				<view class="textline">
					<picker :disabled="!canchange" mode="selector" @change="select($event,2)" :value="item.faultCode"
						:range="faultCode">
						故障：
						<text>{{item.faultCode||"无"}}</text>
					</picker>
				</view>
				<view class="textline" style="display: flex;">
					<text>解决：</text>
					<u--input placeholder="请输入" border="bottom" height="10rpx" type="textarea"
						v-model="item.solveMethod" :disabled="!canchange" clearable>
					</u--input>
				</view>
				<view class="textline">
					是否修复：
					<radio-group @change="isFixedChange" style="display:inline-block;">
						<label class="uni-list" v-for="(Item, index) in isFixedChoose" :key="index">
							<radio :disabled="!canchange" :value="Item.value" :checked="Item.value == item.isFixed" />
							<text style="margin-right: 10px;">{{Item.name}}</text>
						</label>
					</radio-group>
				</view>
				<view class="textline" style="display: flex;">确认人： <u--input placeholder="请输入" border="bottom"
						height="10rpx" type="textarea" v-model="item.storeConfirmer" :disabled="!canchange" clearable>
					</u--input>
				</view>
			</view>

			<!-- 上门 -->
			<view class="card-public" v-if="item.repairType == '入店支持'">
				<view class="textline" v-if="!canchange">结束：{{item.departureTime}}</view>
				<view class="textline">
					<text>现场验收图片：</text>
					<u-upload :disabled="!canchange" :deletable="canchange" :fileList="fileList2" @afterRead="afterRead"
						@delete="deletePic" name="2" multiple :maxCount="10"></u-upload>
				</view>
				<view class="textline">
					<text>签单：</text>
					<u-upload :disabled="!canchange" :deletable="canchange" :fileList="fileList3" @afterRead="afterRead"
						@delete="deletePic" name="3" multiple :maxCount="10"></u-upload>
				</view>
				<view class="textline" style="display: flex;">
					<text>旧设备：</text>
					<u--input placeholder="序列号(非必填)" border="bottom" height="10rpx" type="textarea" v-model="item.oldSn"
						:disabled="!canchange" clearable>
					</u--input>
				</view>
				<view class="textline">
					<text>旧设备照片：</text>
					<u-upload :disabled="!canchange" :deletable="canchange" :fileList="fileList5" @afterRead="afterRead"
						@delete="deletePic" name="5" multiple :maxCount="10"></u-upload>
				</view>
				<view class="textline" style="display: flex;">
					<text>新设备：</text>
					<u--input placeholder="序列号(非必填)" border="bottom" height="10rpx" type="textarea" v-model="item.newSn"
						:disabled="!canchange" clearable>
					</u--input>
				</view>
				<view class="textline">
					<text>新设备照片：</text>
					<u-upload :disabled="!canchange" :deletable="canchange" :fileList="fileList6" @afterRead="afterRead"
						@delete="deletePic" name="6" multiple :maxCount="10"></u-upload>
				</view>
			</view>


			<!-- 远程 -->
			<view class="card-public" v-else-if="item.repairType == '远程' ||item.repairType == '电话'">
				<view class="textline">
					<text :disabled="!canchange">去电时间</text>
					<uni-datetime-picker v-model="item.callStoreTime" :disabled="!canchange" />
				</view>
				<view class="">
					<text>去电照片</text>
					<u-upload :disabled="!canchange" :deletable="canchange" :fileList="fileList1" @afterRead="afterRead"
						@delete="deletePic" name="1" multiple :maxCount="10"></u-upload>
				</view>
			</view>

			<view v-if="canchange" class="card-public">
				<text>工程师现场反馈：</text>
				<u--input placeholder="请输入:" height="10rpx" type="textarea" v-model="orderRemark.remark" clearable>
				</u--input>
			</view>

			<view v-if="canchange" class="sub">
				<u-button type="primary" @click="save" text="保存草稿"></u-button>
				<u-button type="primary" @click="sub" :disabled="subDisabled" text="提交"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '@/utils/request.js'
	export default {
		data() {
			return {
				canchange: true,
				BaseUrl: "",
				item: {
					isGet: null, //是否收到货物
					arriveTime: null, //确认进场时间
					isOptionalDate: null, //核对点位时间
					wireStateTime: null, //综合布线状态 时间
					wireState: null, //综合布线状态
					eleState: null, //弱电端接状态
					eqIsPresent: null, //机柜到场日期 是否到场
					eqIsOptionalTime: null, //机柜到场日期 时间
					signState: null, //签单状态
					isFixed: undefined,

					connectStoreTime: '', //联系门店时间
					departureTime: '', //结束时间
					storeConfirmer: '', //门店确认人
					callStoreTime: '', //去电时间
					oldSn: '', //旧设备序列号
					newSn: '', //新设备序列号

					serialNumber: null, //序列号
					faultEquipment: null, //MA故障设备

					faultClass: null, //MA故障分类	
					faultCode: null, //MA故障代码	
					// soluteCode: null, //MA解决代码	
					solveMethod: '', //解决
					repairType: "", //MA解决类型

					workOrderId: '',
					finishTime: null,
					workOrderStatus: 20, //工单状态
					workOrderTypeId: null, //工单类型

				},
				subDisabled: false,
				workOrderImagesBos: [],
				detailInfo: {},
				// remarkinfo: {},
				fileList0: [], //无用照片
				fileList1: [], //去电照片
				fileList2: [], //现场验收图片
				fileList3: [], //签单图片
				fileList4: [], //报修照片
				fileList5: [], //旧设备照片
				fileList6: [], //新设备照片
				remarklist: [],
				historyList: [],
				orderRemark: {
					remarkType: 13,
					remark: undefined,
					workOrderId: undefined
				},
				value: null,
				show: {
					show1: false,
					show2: false,
					show3: false,
					show4: false,
				},
				isFixedChoose: [{
					value: 1,
					name: '是'
				}, {
					value: 0,
					name: '否'
				}],
				//MA故障分类
				// faultClassName: [],
				//MA故障代码
				faultCode: [],
				//MA解决代码
				// soluteCode: [],
				//MA解决类型
				repairType: ['远程', '入店支持', '电话'] //remote Onsite
			};
		},
		computed: {
			remarktitle() {
				switch (this.detailInfo.workOrderTypeId) {
					case 1:
						return "派单备注"
					case 5:
						return "申请转单备注"
					case 10:
						return "拒绝转单理由"
					case 15:
						return "审核驳回理由"
					case 13:
						return "工程师现场反馈"
					case 20:
						return "项目经理备注"
					default:
						return "备注字典找不到"
				}
			},
			workid() {
				if (this.detailInfo.workOrderId) {
					return this.detailInfo.workOrderId[0] + this.detailInfo.workOrderId[1] + this.detailInfo.workOrderId[2]
				} else {
					return 'KSb';
				}

			}
		},
		onLoad(option) {
			// this.getSoluteCode()
			this.getFaultCode()
			// this.getFaultClassName()
			this.mountSelect(option.workOrderId)
			this.BaseUrl = getApp().globalData.BaseUrl
			// this.getDict("ma_fault_class")
			if (option.canchange == "true") {
				this.canchange = true
			} else {
				this.canchange = false
			}
			// uni.getStorageSync(option.workOrderId)
			// uni.removeStorageSync('item');
		},
		methods: {
			isFixedChange(evt) {
				console.log('isFixedChange方法', evt.detail.value);
				this.item.isFixed = evt.detail.value - 0;
				console.log(this.item.isFixed);
			},
			async getFaultCode() {
				const res = await request({
					url: 'prod-api/system/dict/data/type/sb_ma_fault_code'
				})
				console.log('sbMaFaultCode为：', res.data);
				for (let i in res.data) {
					this.faultCode.push(res.data[i].dictLabel);
				}
			},
			select(item, num) {
				console.log("select", num, item.detail);
				switch (num) {
					case 1:
						this.item.faultClass = item.detail.value - 0;
						break;
					case 2:
						this.item.faultCode = this.faultCode[item.detail.value];
						break;
					case 3:
						// this.item.soluteCode = this.soluteCode[item.detail.value];
						break;
					case 4:
						this.item.repairType = this.repairType[item.detail.value];
						break;
				}
			},
			// 预览图片
			previewfileList0Image(demoUrl, index) {
				console.log(demoUrl);
				let urlArray = []
				this[`fileList${index}`].forEach((item) => {
					urlArray.push(item.url)
				})
				console.log(urlArray);
				uni.previewImage({
					urls: urlArray,
					current: demoUrl + '',
					success: (successres) => {},
					fail: (errorMessage) => {},
					complete: (res) => {}
				})
			},
			// getDict(dictType) {
			// 	request({
			// 		url: "prod-api/system/dict/data/type/" + dictType,
			// 		method: "get",
			// 	}).then((res) => {
			// 		console.log("dict", res)
			// 	})
			// },
			changeTime(value) {
				let time = new Date()
				if (value) {
					time = new Date(value)
				}
				let year = time.getFullYear() + ''
				let month = (time.getMonth() + 1) + ''
				let date = time.getDate() + ''
				let h = time.getHours() + ''
				let m = time.getMinutes() + ''
				let s = time.getSeconds() + ''
				month = month > 9 ? month : '0' + month;
				date = date > 9 ? date : '0' + date;
				h = h > 9 ? h : '0' + h
				s = s > 9 ? s : '0' + s
				m = m > 9 ? m : '0' + m
				const tt = year + "-" + month + "-" + date + " " + h + ":" + m + ":" + s;
				return tt
			},
			callStoreTimeConfirm(evt) {
				this.item.callStoreTime = this.changeTime(evt.value)
				console.log(this.item);
				this.callStoreTimeShow = false
			},

			gettime() {
				var nowdate = new Date();
				var year = nowdate.getFullYear()
				var month = nowdate.getMonth() + 1
				var date = nowdate.getDate()
				// var day = nowdate.getDay()
				var h = nowdate.getHours()
				var m = nowdate.getMinutes()
				var s = nowdate.getSeconds()
				var nowtime = year + "-" + month + "-" + date + " " + h + ":" + m + ":" + s;
				return nowtime
			},
			clearLocal() {
				uni.removeStorageSync(this.detailInfo.workOrderId);
				uni.removeStorageSync(this.detailInfo.workOrderId + "img");
				uni.removeStorageSync(this.detailInfo.workOrderId + "filelist1");
				uni.removeStorageSync(this.detailInfo.workOrderId + "filelist2");
				uni.removeStorageSync(this.detailInfo.workOrderId + "filelist3");
				uni.removeStorageSync(this.detailInfo.workOrderId + "filelist5");
				uni.removeStorageSync(this.detailInfo.workOrderId + "filelist6");
				uni.removeStorageSync(this.detailInfo.workOrderId + "item");
			},
			//提交
			sub() {
				this.subDisabled = true;
				if (this.item.repairType == '入店支持') {
					this.item.departureTime = this.gettime(); //给离店时间赋值
				}

				setTimeout(() => {
					this.subDisabled = false;
				}, 3000);
				this.item.workOrderId = this.detailInfo.workOrderId
				this.item.finishTime = this.gettime()
				var obj = this.item
				for (var key in obj) {
					if (obj[key] == null) {
						delete obj[key]
					}
				}
				this.item = obj;
				this.sbma();
			},
			//保存草稿
			save() {
				uni.setStorage({
					key: this.detailInfo.workOrderId, // 存储值的名称
					data: this.item, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "img", // 存储值的名称
					data: this.workOrderImagesBos, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "filelist1", // 存储值的名称
					data: this.fileList1, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "filelist2", // 存储值的名称
					data: this.fileList2, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "filelist3", // 存储值的名称
					data: this.fileList3, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "filelist5", // 存储值的名称
					data: this.fileList5, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "filelist6", // 存储值的名称
					data: this.fileList6, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "item", // 存储值的名称
					data: this.item, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.reLaunch({
					url: '/pages/home/sb/sbmain'
				})

			},
			get(option) {
				uni.getStorage({
					key: option.workOrderId, // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.item = res.data // hello  这里可做赋值的操作 
					}
				})
				uni.getStorage({
					key: option.workOrderId + "img", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.workOrderImagesBos = res.data // hello  这里可做赋值的操作
					}
				})
				uni.getStorage({
					key: option.workOrderId + "filelist2", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.fileList2 = res.data // hello  这里可做赋值的操作 
					}
				})
				uni.getStorage({
					key: option.workOrderId + "filelist3", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.fileList3 = res.data // hello  这里可做赋值的操作
					}
				})
				uni.getStorage({
					key: option.workOrderId + "filelist5", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.fileList5 = res.data // hello  这里可做赋值的操作
					}
				})
				uni.getStorage({
					key: option.workOrderId + "filelist6", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.fileList6 = res.data // hello  这里可做赋值的操作
					}
				})
				uni.getStorage({
					key: option.workOrderId + "item", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.item = res.data // hello  这里可做赋值的操作
					}
				})
			},
			// 删除图片
			deletePic(event) {
				this[`fileList${event.name}`].splice(event.index, 1)
			},
			// 新增图片
			async afterRead(event) {
				// 当设置 mutiple 为 true 时, file 为数组格式，否则为对象格式
				console.log(event);
				let lists = [].concat(event.file)
				let fileListLen = this[`fileList${event.name}`].length
				lists.map((item) => {
					this[`fileList${event.name}`].push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url, event.name)
					let item = this[`fileList${event.name}`][fileListLen]
					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
			},
			uploadFilePromise(url, name) {

				return new Promise((resolve, reject) => {
					uni.$u.http.upload(`${this.BaseUrl}/prod-api/system/oss/upload`, {
						params: {},
						/* 会加在url上 */
						// #ifdef APP-PLUS || H5
						files: [], // 需要上传的文件列表。使用 files 时，filePath 和 name 不生效。App、H5（ 2.6.15+）
						// #endif
						filePath: url, // 要上传文件资源的路径。
						// 注：如果局部custom与全局custom有同名属性，则后面的属性会覆盖前面的属性，相当于Object.assign(全局，局部)
						custom: {
							auth: true
						}, // 可以加一些自定义参数，在拦截器等地方使用。比如这里我加了一个auth，可在拦截器里拿到，如果true就传token
						name: 'file', // 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容
						// #ifdef H5 || APP-PLUS
						timeout: 60000, // H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)
						// #endif
						header: {
							Authorization: uni.getStorageSync("token")
						},
						/* 会与全局header合并，如有同名属性，局部覆盖全局 */
						formData: {}, // HTTP 请求中其他额外的 form data
						// 返回当前请求的task, options。请勿在此处修改options。非必填
						getTask: (task, options) => {},
					}).then((res) => {
						if (name == 1) {
							this.workOrderImagesBos.push({
								imagePath: res.data.data.url.replace("blob:", ""),
								imageTypeId: "66",
								workOrderId: this.detailInfo.workOrderId
							})
						} else if (name == 2) {
							this.workOrderImagesBos.push({
								imagePath: res.data.data.url.replace("blob:", ""),
								imageTypeId: "5",
								workOrderId: this.detailInfo.workOrderId
							})
						} else if (name == 3) {
							this.workOrderImagesBos.push({
								imagePath: res.data.data.url.replace("blob:", ""),
								imageTypeId: "1",
								workOrderId: this.detailInfo.workOrderId
							})
						} else if (name == 5) {
							this.workOrderImagesBos.push({
								imagePath: res.data.data.url.replace("blob:", ""),
								imageTypeId: "62",
								workOrderId: this.detailInfo.workOrderId
							})
						} else if (name == 6) {
							this.workOrderImagesBos.push({
								imagePath: res.data.data.url.replace("blob:", ""),
								imageTypeId: "64",
								workOrderId: this.detailInfo.workOrderId
							})
						}
						resolve(res.data.data.url)
						// 返回的res.data 已经进行JSON.parse
					}).catch(err => {

					})


					// let a = uni.uploadFile({
					// 	url: 'http://192.168.2.21:7001/upload', // 仅为示例，非真实的接口地址
					// 	filePath: url,
					// 	name: 'file',
					// 	formData: {
					// 		user: 'test'
					// 	},
					// 	success: (res) => {
					// 		setTimeout(() => {
					// 			resolve(res.data.data)
					// 		}, 1000)
					// 	}
					// });
				})
			},

			//请求有关
			async mountSelect(workOrderId) {
				await request({
					url: "prod-api/system/sb-maWorkOrder/" + workOrderId,
					method: "get",
				}).then((res) => {
					if (res.code < 300) {
						console.log(1);
						this.detailInfo = res.data;
						this.item = res.data;
						console.log(2);
						let couNum = 1;
						if (res.data.workOrderImagesVos) {
							res.data.workOrderImagesVos.forEach((item, index) => {
								switch (item.imageTypeId - 0) {
									case 66:
										couNum = 1;
										break;
									case 5:
										couNum = 2;
										break;
									case 1:
										couNum = 3;
										break;
									case 60:
										couNum = 4;
										break;
									case 62:
										couNum = 5;
										break;
									case 64:
										couNum = 6;
										break;
									default:
										couNum = 0;
										break;
								}
								this[`fileList${couNum}`].push({
									type: "image",
									url: item.imagePath,
									status: "success",
									name: "",
									message: "",
									thumb: "",
									size: 60489
								})
							})
						}
						this.doremark(res.data.workOrderRemarkVos)

					}
				})

				await this.get({
					workOrderId
				})
			},
			//导出订单图片
			downImages(type) {
				// if(type=="导出PDF图纸"){
				// 	var paramsData={
				// 		imageTypeId: "20",
				// 		workOrderId: this.detailInfo.workOrderId
				// 	}
				// }else if(type=="导出设备清单"){
				// 	var paramsData={
				// 		imageTypeId: "25",
				// 		workOrderId: this.detailInfo.workOrderId
				// 	}
				// }
				request({
					url: "prod-api/system/orderImages/downloadList?imagesBos=" + this.detailInfo.workOrderId,
					method: "get",
				}).then((res) => {
					console.log(res)
					if (res.code < 300) {
						uni.downloadFile({
							url: res.data,
							success: (res) => {
								if (res.statusCode === 200) {
									uni.saveImageToPhotosAlbum({
										filePath: res.tempFilePath,
										success: function() {
											uni.showToast({
												title: "保存成功",
												icon: "none"
											});
										},
										fail: function() {
											uni.showToast({
												title: "保存失败，请稍后重试",
												icon: "none"
											});
										}
									});
								}
							}
						})
					}
				})
			},

			sbma() {
				this.item.workOrderTypeId = 1
				this.item.workOrderStatus = 20
				console.log(this.item)
				console.log(this.workOrderImagesBos)
				this.orderRemark.workOrderId = this.item.workOrderId
				this.item.workOrderImagesBos = this.workOrderImagesBos
				request({
					url: "prod-api/system/orderRemark",
					method: "post",
					data: this.orderRemark
				}).then((res) => {
					console.log(res)
				})
				request({
					url: "prod-api/system/sb-maWorkOrder",
					method: "put",
					data: this.item,

				}).then((res) => {
					console.log(res)
					if (res.code < 300) {
						this.clearLocal()
						uni.reLaunch({
							url: '/pages/home/sb/sbmain'
						})
					}
				})
			},
			doremark(data = []) {
				console.log(data)
				const copyItem = this.detailInfo
				console.log('copyItem:', copyItem);
				this.historyList.push({
					id: 0,
					descTime: copyItem.mailReceiveTime,
					title: '邮件接单时间',
					istrue: !!copyItem.mailReceiveTime && true
				}, {
					id: 1,
					descTime: copyItem.createTime,
					title: '派单时间',
					istrue: !!copyItem.createTime && true
				}, {
					id: 2,
					descTime: copyItem.pickOrderTime,
					title: '工程师接单时间',
					istrue: !!copyItem.pickOrderTime && true
				}, {
					id: 3,
					descTime: copyItem.expectArriveTime,
					title: '预计到场时间 ',
					istrue: !!copyItem.expectArriveTime && true
				}, {
					id: 4,
					descTime: copyItem.arriveTime,
					title: '到场时间',
					istrue: !!copyItem.arriveTime && true
				}, {
					id: 5,
					descTime: copyItem.finishTime,
					title: '解决时间',
					istrue: !!copyItem.finishTime && true
				}, {
					id: 6,
					descTime: copyItem.endOrderTime,
					title: '审核时间',
					istrue: !!copyItem.endOrderTime && true
				})
				data.forEach((item, index) => {
					this.remarklist.push({
						id: index,
						title: item.remarkTypeName,
						title1: "",
						desc: item.remark,
						isture: true,
						url: ""
					})
				})
				console.log(this.remarklist)
				console.log(this.historyList);
			}
		}
	}
</script>

<style lang="scss">
	.contain {
		width: 100%;
		height: 100%;
		position: absolute;
		background-color: rgb(245, 245, 245);

		.card-contain {
			.card-public {
				display: flex;
				flex-direction: column;
				background-color: white;
				justify-content: space-between;
				width: 90%;
				margin: 30upx 5%;
				box-sizing: border-box;
				padding: 10upx 0;
				padding-left: 40upx;
				border-radius: 30upx 30upx 30upx 30upx;
				box-shadow: 0 0 15px rgb(232, 232, 232);

				.textline {
					border-bottom: 1px solid rgb(218, 219, 222);
					// color: rgb(192, 196, 204);
					width: 100%;
					line-height: 60upx;
					font-size: 30rpx;
				}

				.radio {
					margin-top: 20upx;
				}

				text {
					font-size: 32upx;
					margin-top: 8upx;
					margin-bottom: 20upx;
				}
			}

			.btn {
				display: flex;
			}

		}

		.sub {
			display: flex;
			justify-content: space-between;

			button {
				width: 300upx;
				height: 60upx;
			}

			padding-bottom: 100upx;
		}
	}

	.zong {

		.user_for {
			display: flex;
		}

		.item_year {
			font-size: 34rpx;
			height: 50rpx;
		}

		.line_for {
			width: 4rpx;
			height: 24rpx;
			margin: 0 20rpx 10rpx;

		}

		.line_radio {
			width: 20rpx;
			height: 20rpx;
			border-radius: 50%;
			position: relative;
			left: 50%;
			transform: translateX(-50%);
			top: 0;
		}

		.right_box {
			padding: 0rpx 20rpx 20rpx 20rpx;
		}

		.desc {
			font-size: 30rpx;

			display: flex;
			margin-top: 20rpx;
			align-items: center;

		}

	}
</style>
